<script language="JavaScript">
function sendValue(s){
    //var selvalue = s.options[s.selectedIndex].value;
    window.opener.document.catform.cat_image.value = s;
    window.close();
}
</script>
<center><table width="90%" bgcolor="#8FB3E9"><tr>
<td bgcolor="#4D7ABC">
<b>Large Images
</td>
</tr>
<tr>
<td><center>
<?php
$handler = opendir("../../images/category/");
$i = 0;
while($file=readdir($handler)){
    if($file!='.' && $file!='..' && $file!='index.php' && !ereg("^\.",$file) && $file!='Thumbs.db'){
        $file = htmlspecialchars($file);
        echo "<a href=\"javascript:sendValue('".$file."')\" onClick='sendValue('".$file."');'><img src='../../images/category/";
        echo $file;
        echo "' border='0'></a> &nbsp; &nbsp; &nbsp;";
        $i++;
        if(!$i % 3) echo "<br>";
    }
}
?>
</td>
</tr>
</table>